from flask import   Flask,render_template,request

app=Flask(__name__)


@app.route('/register',methods=['GET','POST'])
def register():
    users=[1,2,3,4]
    if request.method=='GET':
        return render_template('register.html',title='注册存储',data_list=users)



@app.route('/do/reg',methods=['POST'])
def do_register():

    #print(request.args)#输出接受get请求的参数数据
    print(request.form)#接受post请求发出的表单数据
    user=request.form.get('user')
    password = request.form.get('pwd')
    city = request.form.get('city')
    print(user,password,city)

    return '注册成功'

if __name__=="__main__":
    app.run()